package com.lmscn.lms.api.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;

public class Teacher extends Model<Teacher> {
	public static final Teacher dao = new Teacher();
	public List<Teacher> getLastestTeachers(int num){
		String sql = "SELECT * FROM t_teacher t ORDER BY t.id DESC LIMIT " + num;
		return dao.find(sql);
	}
	
	public Page<Teacher> getTeacherPage(int pageNumber, int pageSize){
		return dao.paginate(pageNumber, pageSize, "select *", "from t_teacher");
	}
}
